ImageWell Class

Used to display an image in a window.

Events

None

Properties

Image


Methods

None

More information available in parent classes: RectControl:Control:Object

Because this is a RectControl, see the RectControl for other properties and events that are common to all RectControl objects.


Notes

If QuickTime is installed on the user's machine, the additional picture formats supported by QuickTime are also supported. This pertains to Windows and Macintosh only. Native support for the following formats is provided:

Windows

On Windows, an ImageWell can display a BMP or PNG image.

Macintosh

On Macintosh, an ImageWell can display a PICT image.

Linux

On Linux, an ImageWell can display a BMP or PNG image.


Example

The following line of code in the ImageWell's Open event displays a picture of a prancing stallion in the ImageWell. The image had been added to the Project Editor.

me.image=Ferrari

The following example implements drag and drop between two ImageWells, a BMP file dragged from the desktop to either ImageWell, and from one ImageWell to the other. For Macintosh, use the PICT file type instead of BMP.

In the Open event handler of the ImageWells, the two statements tell the controls to accept either a dragged picture or a dragged file of type BMP. The file type "image/x-bmp" was defined previously in the File Type Sets Editor or via the FileType class.

The DropObject event handler is

Sub DropObject(Obj as DragItem)
 If Obj.PictureAvailable then
   Me.Image=Obj.Picture
 elseif Obj.FolderItemAvailable then
   Me.Image=Obj. FolderItem.OpenAsPicture
 End if

:

The MouseDown event handler is

Dim d as DragItem
d= NewDragItem( Me.left, Me.top, Me.width, Me.height)
d.picture= Me.Image
d.Drag //Allow the drag

:


See Also

RectControl class.